﻿using System.Drawing;

namespace ArcEngine.Resources
{

	/// <summary>
	/// Definition of a tile
	/// </summary>
	public class Tile
	{

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="rect"></param>
		/// <param name="hotspot"></param>
		public Tile(Rectangle rect, Point hotspot)
		{
			rectangle = rect;
			hotSpot = hotspot;
		}

		/// <summary>
		/// 
		/// </summary>
		public Tile()
		{
			rectangle = Rectangle.Empty;
			hotSpot = Point.Empty;
		}



		#region Properties

		/// <summary>
		/// Gets / sets the rectangle of the tile in the texture
		/// </summary>
		public Rectangle Rectangle
		{
			get
			{
				return rectangle;
			}
			set
			{
				rectangle = value;
			}
		}
		Rectangle rectangle = Rectangle.Empty;


		/// <summary>
		/// Size of the tile
		/// </summary>
		public Size Size
		{
			get
			{
				return rectangle.Size;
			}
		}

									


		/// <summary>
		/// HotSpot of the tile
		/// </summary>
		public Point HotSpot
		{
			get
			{
				return hotSpot;
			}
			set
			{
				hotSpot = value;
			}
		}
		Point hotSpot = Point.Empty;


		/// <summary>
		/// Gets/sets the collision box of the tile relative to the hotspot
		/// (Usefull for sprites)
		/// </summary>
		public Rectangle CollisionBox
		{
			get
			{
				return collisionBox;
			}
			set
			{
				collisionBox = value;
			}
		}
		Rectangle collisionBox;


		/// <summary>
		/// Get tile colors
		/// </summary>
		public Color[,] Data
		{
			get
			{
				return data;
			}
			internal set
			{
				data = value;
			}
		}
		Color[,] data = null;


/*
		/// <summary>
		/// Collision mask
		/// </summary>
		public bool[,] CollisionMask
		{
			get
			{
				return collisionMask;
			}
			set
			{
				collisionMask = value;
			}
		}
		bool[,] collisionMask;
*/
		#endregion

	}

}
